package com.unknowpupil.sell.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.unknowpupil.sell.domain.ProductCategory;
import com.unknowpupil.sell.mapper.ProductCategoryMapper;
import com.unknowpupil.sell.service.IProductCategoryService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 类目 服务实现类
 * </p>
 *
 * @author AutoGenerator
 */
@Service
public class ProductCategoryServiceImpl extends ServiceImpl<ProductCategoryMapper, ProductCategory> implements IProductCategoryService {
    /**
     * 批量查询类别id
     *
     * @param list
     * @return
     */
    @Override
    public List<ProductCategory> findByCategoryTypeIn(List<Integer> list) {
        LambdaQueryWrapper<ProductCategory> query = new LambdaQueryWrapper<>();
        query.in(ProductCategory::getCategoryType,list);
        List<ProductCategory> productCategories = baseMapper.selectList(query);
        return productCategories;
    }
}
